package com.homedo.odin.solution.controller.pc;

import com.homedo.core.common.base.dto.Meta;
import com.homedo.core.common.base.dto.ResultData;
import com.homedo.odin.solution.contract.pc.PcHotKeywordListResp;
import com.homedo.odin.solution.service.HotKeywordServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * PC端关键词
 *
 * @author liyi Created by liyi on 2018/5/16.
 */
@Api(description = "热搜关键词", tags = {"HotKeyword"}, produces = MediaType.APPLICATION_JSON_VALUE)
@RestController
@RequestMapping("/hot_words")
public class HotKeywordController {

    @Autowired
    HotKeywordServiceImpl baseService;

    @ApiOperation(value = "PC_获取关键词热搜列表", response = PcHotKeywordListResp.class, httpMethod = "GET")
    @GetMapping("/{top}")
    public ResultData getHotKeywords(@PathVariable("top") Integer top) {
        PcHotKeywordListResp resp = baseService.queryPcHotKeywords(top);
        return ResultData.newInstance(Meta.CODE_200, resp);
    }


}
